#include "widget.h"
#include "ui_widget.h"
#include "QPushButton"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    tch = new Teacher(this);
    stu = new student(this);

    QPushButton *button = new QPushButton("上课了",this);
    button->move(100,100);

    connect(tch,&Teacher::MySignal,stu,&student::StartStudy);

    connect(button,&QPushButton::clicked,tch,&Teacher::MySignal);
    EmitSignal();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::EmitSignal()
{
    emit tch->MySignal();
}
